<include file="public:top" />
<!--网站设置-->
<body class="body">
<style type="text/css">
    .red {color: #FF5722!important;}
    .green {color: #5FB878!important;}
</style>
<fieldset class="layui-elem-field layui-field-title" style="margin-top:0px;">
    <legend>{$menuid|getmenuname}</legend>
</fieldset>
<form class="layui-form layui-form-pane" action="">
            <table class="layui-table">
                <colgroup>
                    <col width="">
                    <col width="300">
                    <col width="100">
                    <col width="200">
                    <col width="120">
                    <col>
                </colgroup>
                <thead>
                <tr>
                    <th>{:L('backup_name')}</th>
                    <th>SQL文件名</th>
                    <th>{:L('backup_size')}</th>
                    <th>{:L('backup_time')}</th>
                    <th>{:L('operations_manage')}</th>
                </tr>
                </thead>
                <tbody id="navList">
                <volist name="backups" id="val">
                    <tr>
                      <td><span>{$val.name}</span></td>
                      <td><span><volist name="val['vols']" id="vol">{$vol.file}<a href="{:u('backup/download', array('backup'=>$val['name'], 'file'=>$vol['file']))}"> 点击下载</a></volist></span></td>
                      <td><span>{$val.total_size}kb</span></td>
                      
                      <td><span>{$val.date_str}</span></td>
                      <td><a href="{:u('backup/del_backup', array('backup'=>$val['name']))}" id="delete">{:L('delete')}</a> | 
                    <a href="{:u('backup/import', array('backup'=>$val['name']))}" id="import">{:L('import')}</a></td>
                  </tr>
                </volist>
                </tbody>
            </table>
</form>

<script type="text/javascript" src="__PUBLIC__/admin/layui/layui.js"></script>
<script>
//Demo
layui.use(['layer','jquery','form','element','table'], function () {
   // 操作对象
    var layer = layui.layer,$ = layui.jquery,form = layui.form, element = layui.element,table = layui.table;
  
    

    //删除操作
    $(function(){
        $("tbody#navList tr td #delete").click(function() {
            var delurl = $(this).attr('href');
            $.post(delurl,function(res){

                if(res.status ==  1){
                    layer.msg(res.msg,{time:1800},function(){
                      location.reload(); 
                    });
                }else{
                    layer.msg(res.msg,{time:1800});
                }
            });
            return false;
            
        });
    });

    //导入操作
    $(function(){
        $("tbody#navList tr td #import").click(function() {
            loading =layer.load(1, {shade: [0.1,'#fff']});
            var delurl = $(this).attr('href');
            $.post(delurl,function(res){
                layer.close(loading);
                if(res.status ==  1){
                    layer.msg(res.msg,{time:1800},function(){
                      location.reload(); 
                    });
                }else{
                    layer.msg(res.msg,{time:1800});
                }
            });
            return false;
            
        });
    });

});
</script>
</body>
</html>